include(GoogleTest)
find_package(GTest CONFIG REQUIRED)
find_package(sqlite3 REQUIRED)
#find_package(Boost REQUIRED COMPONENTS thread)

include_directories(
    ${SQLite3_INCLUDE_DIRS}
)

set(BINARY ${CMAKE_PROJECT_NAME}_test)

file(GLOB_RECURSE TEST_SOURCES LIST_DIRECTORIES true *.h *.cpp)
add_executable(${BINARY} ${TEST_SOURCES})

target_link_libraries(${BINARY} PUBLIC
    ${CMAKE_PROJECT_NAME}_lib
    ${SQLite3_LIBRARIES}
    GTest::gtest GTest::gtest_main GTest::gmock GTest::gmock_main
)

#自动寻找测试用例
gtest_discover_tests(${BINARY})
#add_test(NAME ${BINARY} COMMAND ${BINARY})

set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)
